Component({
  properties: {
    visible: {
      type: Boolean,
      value: false,
    },
    remarks: {
      type: String,
      value: '',
    },
  },
  data: {
    currentLength: 0,
  },
  observers: {
    remarks(newRemarks) {
      this.setData({ currentLength: newRemarks.length });
    },
  },
  methods: {
    onInputChange(event) {
      this.setData({ remarks: event.detail.value, currentLength: event.detail.value.length });
    },
    onCancel() {
      this.triggerEvent('cancel');
    },
    onConfirm() {
      this.triggerEvent('confirm', { remarks: this.data.remarks });
    },
  },
});
